import java.util.Scanner;

/**
 * 将一个英文语句以单词为单位逆序排放。例如“I am a boy”，逆序排放后为“boy a am I”
 * 所有单词之间用一个空格隔开，语句中除了英文字母外，不再包含其他字符
 * Created by JiaJia on 2019/6/19 0019.
 */
public class HuaWei013 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()){
            String input=scanner.nextLine();
            String[] str=input.split(" ");
            System.out.println(reverseSentence(str));
        }
        scanner.close();
    }
    private static String reverseSentence(String[] strings){
       StringBuilder sb=new StringBuilder();
        for (int i = 0; i <strings.length ; i++) {
            sb.append(reverseString(strings[i])).append(" ");
        }
        String string=reverseString(sb.substring(0,sb.length()-1));
        return string;
    }
    private static String reverseString(String str){
        StringBuilder builder=new StringBuilder();
        for (int i = str.length()-1; i >=0 ; i--) {
            builder.append(str.charAt(i));
        }
        return builder.toString();
    }
}